<template>
  <el-submenu :index="tIndex+''"  >
    <template slot="title">
      <i :class="tClass"></i>
      <span slot="title">{{tTitle}}</span>
    </template>
    <el-menu-item v-for="(item, index) in tChild" :key="item.id" :index="tIndex+'-'+index" @open="handleOpen" @close="handleClose" >{{item.name}}</el-menu-item>
  </el-submenu>
</template>

<script>
export default {
  props: {
    tIndex: {
      type: Number,
      required:false
    },
    tClass: {
      type: String,
      required:false
    },
    tTitle: {
      type: String,
      required:false
    },
    tIsparent: {
      type: Boolean,
      required:false
    },
    tChild: {
      type: Array,
      required:false
    },
  },
  data () {
    return {
    }
  },
  methods: {
    handleOpen (key, keyPath) {
      console.log(key, keyPath)
    },
    handleClose (key, keyPath) {
      console.log(key, keyPath)
    }
  },
  created: function () {
    // console.info(this.tIndex)
  },
}
</script>
